All Functions Used So Far, Week 3

labs

{GGPLOT2}

Customise labels in GGPLOT2

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

select

{dplyr}

Select columns from a tibble/data frame

is.na

{base}

Check if a value is NA/elements of vector are NA

pwr.r.test

{pwr}

Power analysis for correlation tests

element_text

{GGPLOT2}

Customise text in GGPLOT2

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

chisq.test

{stats}

Chi-Squared test (e.g. for cross-tabulations)

cor.test

{stats}

Test for Association/Correlation Between Paired Samples

factor

{base}

Create a factor

complete.cases

{stats}

Find Complete Cases

mean

{base}

Get mean of a vector

cut

{base}

Convert Numeric to Factor

recode

{dplyr}

Recode a variable

sum

{base}

Get sum of numeric values or a vector

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

as.integer

{base}

Convert an object to integer values

c

{base}

Combine values/vectors into a vector

prop.table

{base}

Transform frequency table into table of proportions

margin

{GGPLOT2}

Set margins around plot elements (used inside theme elements)

theme

{GGPLOT2}

Customize ggplot themes

geom_jitter

{GGPLOT2}

Add randomly displaced points to reduce overplotting

factor

{base}

Create factor variables

mutate

{dplyr}

Create new variables

sd

{stats}

Get standard deviation of a vector

geom_smooth

{GGPLOT2}

Generates a smoothed conditional means curve / line

scale_y_continuous

{GGPLOT2}

Customise continuous y axis

round

{base}

Rounds numbers

ggplot

{GGPLOT2}

Create a ggplot graph

vdem

{vdemdata}

V-Dem country-year dataset

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

read_csv

{readr}

Read CSV files

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

element_blank

{GGPLOT2}

This theme element draws nothing, and assigns no space

datasummary

{modelsummary}

Create customizable summary-statistics tables

geom_point

{GGPLOT2}

Generates a scatter plot

correlation_matrix

{corrtable}

Create a formatted correlation matrix of variables

read_excel

{readxl}

Read an Excel file

library

{base}

Load an R package

filter

{dplyr}

Filter out rows of a data frame according to logical vector

setwd

{base}

Set Working Directory

The end!